#ifndef RESULT_H
#define RESULT_H

#include <QWidget>
#include<QString>
#include<QMessageBox>
#include<QPagedPaintDevice>
#include"uploadimage.h"
#include<QSqlQuery>
namespace Ui {
class result;
}

class result : public QWidget
{
    Q_OBJECT

public:
    explicit result(QWidget *parent = 0);
    ~result();
    void savePicture(QString image);
    void saveMessage(int id,QString message);

private slots:


    //接受检测界面传过来的输出图片（槽函数）和个数
    void getOutputImageName(QString outputImageName,QString mes,bool isN);

    void on_pushButton_save_clicked();

    void on_pushButton_print_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

private:

    Ui::result *ui;
    QSqlQuery query;
    //检测界面传过来的图片
    QString outputImageName;

    //结肠息肉的个数
    int detectNum;
    //结肠息肉的信息
    QString message;

    //上传后的网络url
    QString resultImageUrl;
    //
    uploadImage *up;

    //是新检测到的，还是历史记录
    bool isNew=false;

    //登陆者姓名
    QString userName;

    //ct_id
    int ct_id;

    bool isPost=false;

    //user_id
    int user_id;

    //生成pdf文件
    void createPdfResult(QString fileName,QString textResult);
    //绘制pdf
    void paintPdf(QPagedPaintDevice *device,QString realName,QString realSex,QString realAge,QString realID);

    //字符串获取息肉个数
    void getNumber(QString msg);
    //息肉个数转为message
    void setMessage(int num);
};

#endif // RESULT_H
